package gui;

import javax.swing.JPanel;

public class PanelFactory {
	
	private static PanelFactory instance;
	final private String CLIENT = "Usager.Client";
	final private String LIVREUR = "Usager.Livreur";
	
	private PanelFactory(){
		
	}
	
	public static PanelFactory getInstance(){
		
		if (instance == null){ instance = new PanelFactory();}
		return instance;
	}
	
	public JPanel CreePanel(String nom){
		JPanel panel = null;
		if (nom.equals(CLIENT)){
			System.out.println("client");
			panel = new ClientPanel();
			System.out.println("client2");
		}
		else if (nom.equals(LIVREUR)){
			panel = new LivreurPanel();
		}
		return panel;
	}

}
